﻿using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace LifeSoft.DataLayer
{
    public class SqlDataProvider
    {
        public static string Connectionstring = ConfigurationManager.ConnectionStrings["strConnect"].ConnectionString.ToString();
        public static SqlConnection GetConnection(string conectionstring)
        {
            var connection = new SqlConnection(conectionstring);
            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
                return connection;
            }
            else
            {
                return connection;
            }
        }
    }
}
